package com.maya.medicalwastes.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.maya.medicalwastes.R;
import com.maya.medicalwastes.entity.CollectBean;
import com.maya.medicalwastes.entity.KeyBean;

import java.util.List;

/**
 * @author created by fuguoyong
 * 版本：1.0
 * 创建日期：2020-11-19 13
 * 描述：CollectListAdapter
 */
public class WareItemAdapter extends BaseQuickAdapter<KeyBean, BaseViewHolder> {

    public WareItemAdapter(int layoutResId, @Nullable List<KeyBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, KeyBean item) {
        helper.setText(R.id.tv_type, item.getValue());

        if (item.isCheck()) {
            helper.setBackgroundRes(R.id.tv_type, R.drawable.shape_day_bg);
        } else {
            helper.setBackgroundRes(R.id.tv_type, R.drawable.shape_bg_tiltle_type);

        }
        helper.addOnClickListener(R.id.tv_type);

    }
}
